<?php
/**
 * 
 * @author tangbl
 *
 */
class IndexAction extends CommonAction{
	
	
	/**
	 * 应用首页
	 */
	public function index(){		
		import('@.ORG.RBAC');
		$roleid = session(C('USER_AUTH_ROLE'));
		$userid = session(C('USER_AUTH_KEY'));
		
		RBAC::saveAccessAction($userid);
		
		$menu   = RBAC::saveAccessMenu($roleid,$userid);
		
		$this->assign("menu",$menu);
		
		$this->display();
	}
	
	//获取最新消息
	public function getNews(){
	
		//新订单
		$map['table'] = 'Order';
		$map['where']['status'] = 1;
		$map['where']['isdel']  = 2;
		$order = sendRest('BDC/Content/contentCount',$map,'post');
	
		if($order['data']>0){
			$arr[0] = array(
					'ehref'   => U('Order/index'),
					'etitle'  => '订单管理',
					'ewidth'  => '1100',
					'eheight' => '500',
					'eid'     => 'Order_index',
					'value'   => '<i class="icon-info-sign"></i> 您收到<strong>'.$order['data'].'</strong>条新订单 <span class="btn bg_green white cursor" style="padding:2px 5px;line-height:20px;">立即处理 <i class="icon-chevron-sign-right"></i></span>',
			);
		}
		$jsonData['content'] = $arr;
		$this->ajaxReturn($jsonData,'JSON');
	}
	
	/**
	 * 清除缓存
	 */
	public function cache(){
		
	}
	
	/**
	 * 系统设置
	 */
	public function config(){
		
	}
	

}
